﻿using Hcf.Office.Word;

namespace Hcf.Office.App
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] paths = new string[]
            {
                "1.docx","2.docx"
            };
            
            //合并1，表格border、图片会丢失
            var bytes1 = WordHelper.MergeWordFiles1(paths, true);
            using (FileStream stream = new FileStream("MergeWord1.docx", FileMode.Create))
            {
                stream.Write(bytes1, 0, bytes1.Length);
                stream.Flush();
                stream.Close();
            }
            Console.WriteLine("Word文档1合并完成");

            //合并2，内容完整
            var bytes2 = WordHelper.MergeWordFiles2(paths, true);
            using (FileStream stream = new FileStream("MergeWord2.docx", FileMode.Create))
            {
                stream.Write(bytes2, 0, bytes2.Length);
                stream.Flush();
                stream.Close();
            }

            Console.WriteLine("Word文档2合并完成");

            Console.ReadKey();
        }
    }
}
